package ru.papergames.model.proxies
{
	import ru.papergames.model.proxies.HTTPProxy;

	public class PlayersPoolProxy extends MainHTTPProxy
	{
		
		public static const NAME:String = 'PlayersPoolProxy';
		
		//methods
		public static const GET_DATA:String = 'getData';
		
		//responses
		public static const GET_DATA_START:String = GET_DATA + HTTPProxy.START_NOTE_POSTFIX;
		public static const GET_DATA_SUCCESS:String = GET_DATA + HTTPProxy.SUCCESS_NOTE_POSTFIX;
		public static const GET_DATA_FAULT:String = GET_DATA + HTTPProxy.FAULT_NOTE_POSTFIX;
		
		public function PlayersPoolProxy(url:String)
		{
			super(NAME, url, null);
			useOperationParam = false;
		}
		
		override public function onRegister():void {
			super.onRegister();			
			
		}
		
		override public function onRemove():void {
			super.onRemove();			
			
		}
				
		override protected function parseResponse(data:XML, ownResponse:Boolean):void {
			
		}
		
		/*****  Call handlers  *****/
		
		/* getData */
		
		public function getData_Result(data:XML):String {
			var isSuccess:Boolean = String(data.data.success) == 'true';
						
			return isSuccess ? GET_DATA_SUCCESS : GET_DATA_FAULT;
		}
		
	}
}